﻿//-----------------------------------------------------------------------
// <copyright file="Program.cs" company="Sergey Daletskiy">
//     Copyright Sergey Daletskiy. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Evolution
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Main application class.
    /// </summary>
    public class Program
    {
        /// <summary>
        /// Main proc.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            Console.WindowHeight = 32;

            Field field = new Field(30);
            field.RenderToConsole();

            while (true)
            {
                ConsoleKey key = Console.ReadKey().Key;

                if (key != ConsoleKey.Escape)
                {
                    switch (key)
                    {
                        case ConsoleKey.Spacebar:
                            Console.Clear();
                            field.Update();
                            field.RenderToConsole();
                            break;
                    }
                }
                else
                {
                    break;
                }
            }
        }
    }
}
